function userReducer(state = {}, action) {

    let preState = { ...state }
    switch (action.type) {
      case 'login':
        preState = action.data
        return preState;
      case 'logout':
        console.log('退出登录')
        preState = {}
        return preState;
      default:
        return state;
    }
  }

  export default userReducer